#pragma once

#include <assert.h>
#include <entt/entt.hpp>

namespace qbe::ecs {
struct Entity {
  Entity(entt::registry* _reg_ptr = nullptr, entt::entity _entity = entt::null) : reg_ptr(_reg_ptr), entity(_entity) {};

  template <typename T>
  T& get() {
    assert(reg_ptr->valid(entity));
    return reg_ptr->get<T>(entity);
  }

  template <typename T>
  const T& get() const {
    assert(reg_ptr->valid(entity));
    return reg_ptr->get<T>(entity);
  }

  entt::registry* reg_ptr;
  entt::entity entity;
};
}  // namespace qbe::ecs